/*增加遮罩*/
function showLoading() {
    $("#loadingModal").modal('show');
}

/*隐藏遮罩*/
function hideLoading() {
    $("#loadingModal").modal('hide');
}

function delayToastr(str) {
    var delayTime = setTimeout(function(){
        toastr.error(str);
    },3000);
    window.clearTimeout(delayTime);
}

function openCommonIsvPage(isvPid) {
    if (!isvPid || isvPid == '') {
        toastr.error(common_no_choose_msg.format("操作"));
        return;
    }
    var postData = {
        isvPid : isvPid,
    };
    var url = basePath + 'common/openCommonIsvPage?t=' + new Date().getTime();
    $.ajax({
        type: 'post',
        url: url,
        dataType: 'json',
        data: postData,
        success : function (data) {
            if(data && data.result){
                showCommonIsvPage(data.content)
            }else if(data&&!data.result){
                toastr.error(data.message);
            }else{
                toastr.error('查询服务商信息失败');
            }
        },
        error: function (request) {
            toastr.error(common_system_error);
        }
    });
}

function showCommonIsvPage(content) {
    if (content) {
        $('#lab_isvPid_com').html(content.isvPid);
        $('#lab_isvName_com').html(content.isvName);
        $('#lab_companyName_com').html(content.companyName);
        $('#lab_companyAddr_com').html(content.companyAddr);
        $('#lab_contactPerson_com').html(content.contactPerson);
        $('#lab_contactPhone_com').html(content.contactPhone);
        $('#lab_bdContact_com').html(content.bdContact);
        var defPath = basePath + 'images/main/default.jpg';
        var isvIcon = (!content.isvIcon || content.isvIcon == '') ? defPath : content.isvIcon;
        $('#lab_isvIcon_com').attr('src', isvIcon);
    }
    $('#commonIsvInfoPage').modal('show');
}